///////////////////////////////////////////////
//Author: Juhapekka Piiroinen
//License: GPLv3
//Webpage: http://code.google.com/p/cutechat
///////////////////////////////////////////////

#ifndef CONTACTPAGE_H
#define CONTACTPAGE_H

#include <QWidget>
#include <QDebug>
#include <QDateTime>

namespace Ui {
    class ContactPage;
}

class ContactPage : public QWidget
{
    Q_OBJECT

public:
    explicit ContactPage(QString bareJid, QWidget *parent = 0);
    ~ContactPage();

    QString getBareJid() { return this->bareJid; }

public slots:
    void updateRoster(QString bareJid, QString fullName, QString nickName, QImage avatar) {
        if (this->bareJid==bareJid) {
            this->fullName = fullName;
            this->nickName = nickName;
            this->avatar = avatar;
            updatePage();
        }
    }

    void on_lineEditSendMessage_returnPressed();
    void receiveMessage(QString message);

signals:
    void sendMessage(QString message);

protected:
    void updatePage();

private:
    Ui::ContactPage *ui;
    QString bareJid;
    QString fullName;
    QString nickName;
    QImage avatar;
};

#endif // CONTACTPAGE_H
